package redis

import (
	"ecms/config"
	"github.com/go-redis/redis/v8"
)

var rdb *redis.Client

func init() {
	conf := config.Redis()
	rdb = redis.NewClient(&redis.Options{
		Addr:     conf.Host + ":" + conf.Port,
		Password: conf.Password,
		DB:       conf.DefaultDb,
	})
}

func Conn() *redis.Client {
	return rdb
}
